﻿#region << 版 本 注 释 >>
/*----------------------------------------------------------------
 * 版权所有 (c) 2022 北京超维景生物科技有限公司 保留所有权利。
 * CLR版本：4.0.30319.42000
 * 文件名：Kernel
 * 
 * 创建者：huangyang
 * 电子邮箱：huangyang@tvscope.cn
 * 创建时间：2023/2/15 9:37:13
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/
#endregion << 版 本 注 释 >>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ImageK.Process;

namespace ImageK.Plugin.Filter
{
    /** ImageJ plugins that process an image should implement this interface.
     *  For filters that have a dialog asking for options or parameters as well
     *  as for filters that have a progress bar and process stacks the
     *  ExtendedPlugInFilter interface is recommended.
     */
    public interface PlugInFilter
    {
        /** This method is called once when the filter is loaded. 'arg',
            which may be blank, is the argument specified for this plugin 
            in IJ_Props.txt or in the plugins.config file of a jar archive
            containing the plugin. 'imp' is the currently active image.
            This method should return a flag word that specifies the
            filters capabilities.
            <p>
            For Plugin-filters specifying the {@link #FINAL_PROCESSING} flag,
            the setup method will be called again, this time with
            arg = "final" after all other processing is done.
         */
        int setup(string arg, ImagePlus imp);

        /** Filters use this method to process the image. If the
            {@link #DOES_STACKS} flag was set, it is called for each slice in
            a stack. With {@link #CONVERT_TO_FLOAT}, the filter is called with
            the image data converted to a FloatProcessor (3 times per
            image for RGB images). ImageJ will lock the image before calling
            this method and unlock it when the filter is finished.
            For PlugInFilters specifying the {@link #NO_IMAGE_REQUIRED} flag
            and not the {@link #DONE} flag, run(ip) is called once with the
            argument <code>null</code>.
         */
        void run(ImageProcessor ip);
    }
}
